<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>General</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GDK参考手册">
<link rel="up" href="reference.html" title="API参考">
<link rel="prev" href="reference.html" title="API参考">
<link rel="next" href="multihead.html" title="Multi-head Support Overview">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="reference.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK参考手册</th>
<td><a accesskey="n" href="multihead.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gdk-General.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gdk-General.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gdk-General"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk-General.top_of_page"></a>General</span></h2>
<p>General — Library initialization and miscellaneous functions</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gdk-General.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gdk/gdk.h&gt;

<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-init" title="gdk_init ()">gdk_init</a>                            (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gdk-General.html#gdk-init-check" title="gdk_init_check ()">gdk_init_check</a>                      (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-parse-args" title="gdk_parse_args ()">gdk_parse_args</a>                      (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>);
const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *	      <a class="link" href="gdk-General.html#gdk-get-display-arg-name" title="gdk_get_display_arg_name ()">gdk_get_display_arg_name</a>            (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *	            <a class="link" href="gdk-General.html#gdk-set-locale" title="gdk_set_locale ()">gdk_set_locale</a>                      (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-set-sm-client-id" title="gdk_set_sm_client_id ()">gdk_set_sm_client_id</a>                (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *sm_client_id</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-exit" title="gdk_exit ()">gdk_exit</a>                            (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> error_code</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-notify-startup-complete" title="gdk_notify_startup_complete ()">gdk_notify_startup_complete</a>         (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-notify-startup-complete-with-id" title="gdk_notify_startup_complete_with_id ()">gdk_notify_startup_complete_with_id</a> (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *startup_id</code></em>);

const <span class="returnvalue">char</span> *        <a class="link" href="gdk-General.html#gdk-get-program-class" title="gdk_get_program_class ()">gdk_get_program_class</a>               (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-set-program-class" title="gdk_set_program_class ()">gdk_set_program_class</a>               (<em class="parameter"><code>const <span class="type">char</span> *program_class</code></em>);

<a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *	                   <a class="link" href="gdk-General.html#gdk-get-display" title="gdk_get_display ()">gdk_get_display</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);

<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-flush" title="gdk_flush ()">gdk_flush</a>                           (<em class="parameter"><code><span class="type">void</span></code></em>);

<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="gdk-General.html#gdk-screen-width" title="gdk_screen_width ()">gdk_screen_width</a>                    (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="gdk-General.html#gdk-screen-height" title="gdk_screen_height ()">gdk_screen_height</a>                   (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="gdk-General.html#gdk-screen-width-mm" title="gdk_screen_width_mm ()">gdk_screen_width_mm</a>                 (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="gdk-General.html#gdk-screen-height-mm" title="gdk_screen_height_mm ()">gdk_screen_height_mm</a>                (<em class="parameter"><code><span class="type">void</span></code></em>);

<a class="link" href="gdk-General.html#GdkGrabStatus" title="enum GdkGrabStatus"><span class="returnvalue">GdkGrabStatus</span></a>       <a class="link" href="gdk-General.html#gdk-pointer-grab" title="gdk_pointer_grab ()">gdk_pointer_grab</a>                    (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> owner_events</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Events.html#GdkEventMask" title="enum GdkEventMask"><span class="type">GdkEventMask</span></a> event_mask</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *confine_to</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Cursors.html#GdkCursor" title="GdkCursor"><span class="type">GdkCursor</span></a> *cursor</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);
enum                <a class="link" href="gdk-General.html#GdkGrabStatus" title="enum GdkGrabStatus">GdkGrabStatus</a>;
<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-pointer-ungrab" title="gdk_pointer_ungrab ()">gdk_pointer_ungrab</a>                  (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gdk-General.html#gdk-pointer-is-grabbed" title="gdk_pointer_is_grabbed ()">gdk_pointer_is_grabbed</a>              (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-set-double-click-time" title="gdk_set_double_click_time ()">gdk_set_double_click_time</a>           (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> msec</code></em>);

<a class="link" href="gdk-General.html#GdkGrabStatus" title="enum GdkGrabStatus"><span class="returnvalue">GdkGrabStatus</span></a>       <a class="link" href="gdk-General.html#gdk-keyboard-grab" title="gdk_keyboard_grab ()">gdk_keyboard_grab</a>                   (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> owner_events</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-keyboard-ungrab" title="gdk_keyboard_ungrab ()">gdk_keyboard_ungrab</a>                 (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);

<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-beep" title="gdk_beep ()">gdk_beep</a>                            (<em class="parameter"><code><span class="type">void</span></code></em>);

<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gdk-General.html#gdk-get-use-xshm" title="gdk_get_use_xshm ()">gdk_get_use_xshm</a>                    (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-set-use-xshm" title="gdk_set_use_xshm ()">gdk_set_use_xshm</a>                    (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> use_xshm</code></em>);

<span class="returnvalue">void</span>                <a class="link" href="gdk-General.html#gdk-error-trap-push" title="gdk_error_trap_push ()">gdk_error_trap_push</a>                 (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="gdk-General.html#gdk-error-trap-pop" title="gdk_error_trap_pop ()">gdk_error_trap_pop</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);

#define             <a class="link" href="gdk-General.html#GDK-WINDOWING-X11:CAPS" title="GDK_WINDOWING_X11">GDK_WINDOWING_X11</a>
#define             <a class="link" href="gdk-General.html#GDK-WINDOWING-WIN32:CAPS" title="GDK_WINDOWING_WIN32">GDK_WINDOWING_WIN32</a>
</pre>
</div>
<div class="refsect1">
<a name="gdk-General.description"></a><h2>Description</h2>
<p>
This section describes the GDK initialization functions and miscellaneous
utility functions.
</p>
</div>
<div class="refsect1">
<a name="gdk-General.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="gdk-init"></a><h3>gdk_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_init                            (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>);</pre>
<p>
Initializes the GDK library and connects to the X server.
If initialization fails, a warning message is output and the application
terminates with a call to <code class="literal">exit(1)</code>.
</p>
<p>
Any arguments used by GDK are removed from the array and <em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> are
updated accordingly.
</p>
<p>
GTK+ initializes GDK in <code class="function">gtk_init()</code> and so this function is not usually needed
by GTK+ applications.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td>the number of command line arguments.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td>the array of command line arguments.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-init-check"></a><h3>gdk_init_check ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gdk_init_check                      (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>);</pre>
<p>
Initializes the GDK library and connects to the X server, returning <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on
success.
</p>
<p>
Any arguments used by GDK are removed from the array and <em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> are
updated accordingly.
</p>
<p>
GTK+ initializes GDK in <code class="function">gtk_init()</code> and so this function is not usually needed
by GTK+ applications.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td>the number of command line arguments.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td>the array of command line arguments.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if initialization succeeded.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-parse-args"></a><h3>gdk_parse_args ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_parse_args                      (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>);</pre>
<p>
解析命令行参数并存储, 以供将来调用<a class="link" href="GdkDisplay.html#gdk-display-open" title="gdk_display_open ()"><code class="function">gdk_display_open()</code></a>时使用。
</p>
<p>
由GDK使用的任何参数将被从数组中删除, 并且<em class="parameter"><code>argc</code></em>和<em class="parameter"><code>argv</code></em>已被更新。
</p>
<p>
如果您使用了<code class="function">gtk_init()</code>、<code class="function">gtk_init_check()</code>、<a class="link" href="gdk-General.html#gdk-init" title="gdk_init ()"><code class="function">gdk_init()</code></a>或<a class="link" href="gdk-General.html#gdk-init-check" title="gdk_init_check ()"><code class="function">gdk_init_check()</code></a>，你不
应该显式地调用这个函数。
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td>
<td>在命令行参数的个数。</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td>
<td>命令行参数数组。</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-get-display-arg-name"></a><h3>gdk_get_display_arg_name ()</h3>
<pre class="programlisting">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *	      gdk_get_display_arg_name            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
获取从命令行传递给<a class="link" href="gdk-General.html#gdk-init" title="gdk_init ()"><code class="function">gdk_init()</code></a>或<a class="link" href="gdk-General.html#gdk-parse-args" title="gdk_parse_args ()"><code class="function">gdk_parse_args()</code></a>的显示(display)名称参数（如果有
的话）。
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>如果显式地指定的话，返回显示(display)名称，否则返回<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>。这个字符串
将被GTK+拥有, 不得修改或释放。</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-set-locale"></a><h3>gdk_set_locale ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *	            gdk_set_locale                      (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Initializes the support for internationalization by calling the <code class="function"><a href="../glib/glib-running.html#setlocale"><code class="function">setlocale()</code></a></code>
system call. This function is called by <code class="function">gtk_set_locale()</code> and so GTK+
applications should use that instead.
</p>
<p>
The locale to use is determined by the <code class="envar">LANG</code> environment variable,
so to run an application in a certain locale you can do something like this:
</p>
<div class="informalexample"><pre class="programlisting">
  export LANG="fr"
  ... run application ...
</pre></div>
<p>
</p>
<p>
If the locale is not supported by X then it is reset to the standard "C"
locale.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the resulting locale.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-set-sm-client-id"></a><h3>gdk_set_sm_client_id ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_set_sm_client_id                (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *sm_client_id</code></em>);</pre>
<p>
Sets the <code class="literal">SM_CLIENT_ID</code> property on the application's leader window so that
the window manager can save the application's state using the X11R6 ICCCM
session management protocol.
</p>
<p>
See the X Session Management Library documentation for more information on
session management and the Inter-Client Communication Conventions Manual
(ICCCM) for information on the <code class="literal">WM_CLIENT_LEADER</code> property. 
(Both documents are part of the X Window System distribution.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>sm_client_id</code></em> :</span></p></td>
<td>the client id assigned by the session manager when the
connection was opened, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to remove the property.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-exit"></a><h3>gdk_exit ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_exit                            (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> error_code</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_exit</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Exits the application using the <code class="function"><code class="function">exit()</code></code> system call.
</p>
<p>
This routine is provided mainly for backwards compatibility, since it used to
perform tasks necessary to exit the application cleanly. Those tasks are now
performed in a function which is automatically called on exit (via the use
of <a href="../glib/glib-Miscellaneous-Utility-Functions.html#g-atexit"><code class="function">g_atexit()</code></a>).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>error_code</code></em> :</span></p></td>
<td>the error code to pass to the <code class="function"><code class="function">exit()</code></code> call.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-notify-startup-complete"></a><h3>gdk_notify_startup_complete ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_notify_startup_complete         (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Indicates to the GUI environment that the application has finished
loading. If the applications opens windows, this function is
normally called after opening the application's initial set of
windows.
</p>
<p>
GTK+ will call this function automatically after opening the first
<span class="type">GtkWindow</span> unless <code class="function">gtk_window_set_auto_startup_notification()</code> is called 
to disable that feature.
</p>
<p class="since">Since 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-notify-startup-complete-with-id"></a><h3>gdk_notify_startup_complete_with_id ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_notify_startup_complete_with_id (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *startup_id</code></em>);</pre>
<p>
Indicates to the GUI environment that the application has finished
loading, using a given identifier.
</p>
<p>
GTK+ will call this function automatically for <span class="type">GtkWindow</span> with custom
startup-notification identifier unless
<code class="function">gtk_window_set_auto_startup_notification()</code> is called to disable
that feature.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>startup_id</code></em> :</span></p></td>
<td>a startup-notification identifier, for which notification
process should be completed</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-get-program-class"></a><h3>gdk_get_program_class ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *        gdk_get_program_class               (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Gets the program class. Unless the program class has explicitly
been set with <a class="link" href="gdk-General.html#gdk-set-program-class" title="gdk_set_program_class ()"><code class="function">gdk_set_program_class()</code></a> or with the <code class="option">--class</code>
commandline option, the default value is the program name (determined
with <a href="../glib/glib-Miscellaneous-Utility-Functions.html#g-get-prgname"><code class="function">g_get_prgname()</code></a>) with the first character converted to uppercase.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the program class.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-set-program-class"></a><h3>gdk_set_program_class ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_set_program_class               (<em class="parameter"><code>const <span class="type">char</span> *program_class</code></em>);</pre>
<p>
Sets the program class. The X11 backend uses the program class to set
the class name part of the <code class="literal">WM_CLASS</code> property on
toplevel windows; see the ICCCM.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>program_class</code></em> :</span></p></td>
<td>a string.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-get-display"></a><h3>gdk_get_display ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *	                   gdk_get_display              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Gets the name of the display, which usually comes from the <code class="envar">DISPLAY</code>
environment variable or the <code class="option">--display</code> command line option.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the name of the display.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-flush"></a><h3>gdk_flush ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_flush                           (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Flushes the X output buffer and waits until all requests have been processed
by the server. This is rarely needed by applications. It's main use is for
trapping X errors with <a class="link" href="gdk-General.html#gdk-error-trap-push" title="gdk_error_trap_push ()"><code class="function">gdk_error_trap_push()</code></a> and <a class="link" href="gdk-General.html#gdk-error-trap-pop" title="gdk_error_trap_pop ()"><code class="function">gdk_error_trap_pop()</code></a>.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-screen-width"></a><h3>gdk_screen_width ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gdk_screen_width                    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns the width of the default screen in pixels.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the width of the default screen in pixels.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-screen-height"></a><h3>gdk_screen_height ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gdk_screen_height                   (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns the height of the default screen in pixels.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the height of the default screen in pixels.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-screen-width-mm"></a><h3>gdk_screen_width_mm ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gdk_screen_width_mm                 (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns the width of the default screen in millimeters.
Note that on many X servers this value will not be correct.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the width of the default screen in millimeters,
though it is not always correct.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-screen-height-mm"></a><h3>gdk_screen_height_mm ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gdk_screen_height_mm                (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns the height of the default screen in millimeters.
Note that on many X servers this value will not be correct.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the height of the default screen in millimeters,
though it is not always correct.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pointer-grab"></a><h3>gdk_pointer_grab ()</h3>
<pre class="programlisting"><a class="link" href="gdk-General.html#GdkGrabStatus" title="enum GdkGrabStatus"><span class="returnvalue">GdkGrabStatus</span></a>       gdk_pointer_grab                    (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> owner_events</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Events.html#GdkEventMask" title="enum GdkEventMask"><span class="type">GdkEventMask</span></a> event_mask</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *confine_to</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Cursors.html#GdkCursor" title="GdkCursor"><span class="type">GdkCursor</span></a> *cursor</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);</pre>
<p>
Grabs the pointer (usually a mouse) so that all events are passed to this
application until the pointer is ungrabbed with <a class="link" href="gdk-General.html#gdk-pointer-ungrab" title="gdk_pointer_ungrab ()"><code class="function">gdk_pointer_ungrab()</code></a>, or
the grab window becomes unviewable.
This overrides any previous pointer grab by this client.
</p>
<p>
Pointer grabs are used for operations which need complete control over mouse
events, even if the mouse leaves the application.
For example in GTK+ it is used for Drag and Drop, for dragging the handle in
the <span class="type">GtkHPaned</span> and <span class="type">GtkVPaned</span> widgets, and for resizing columns in <span class="type">GtkCList</span>
widgets.
</p>
<p>
Note that if the event mask of an X window has selected both button press and
button release events, then a button press event will cause an automatic
pointer grab until the button is released.
X does this automatically since most applications expect to receive button
press and release events in pairs.
It is equivalent to a pointer grab on the window with <em class="parameter"><code>owner_events</code></em> set to
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.
</p>
<p>
If you set up anything at the time you take the grab that needs to be cleaned
up when the grab ends, you should handle the <a class="link" href="gdk-Event-Structures.html#GdkEventGrabBroken" title="struct GdkEventGrabBroken"><span class="type">GdkEventGrabBroken</span></a> events that
are emitted when the grab ends unvoluntarily.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>window</code></em> :</span></p></td>
<td>the <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> which will own the grab (the grab window).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>owner_events</code></em> :</span></p></td>
<td>if <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> then all pointer events are reported with respect to
<em class="parameter"><code>window</code></em> and are only reported if selected by <em class="parameter"><code>event_mask</code></em>. If <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then pointer
events for this application are reported as normal, but pointer events outside
this application are reported with respect to <em class="parameter"><code>window</code></em> and only if selected by
<em class="parameter"><code>event_mask</code></em>. In either mode, unreported events are discarded.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>event_mask</code></em> :</span></p></td>
<td>specifies the event mask, which is used in accordance with
<em class="parameter"><code>owner_events</code></em>. Note that only pointer events (i.e. button and motion events)
may be selected.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>confine_to</code></em> :</span></p></td>
<td>If non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the pointer will be confined to this
window during the grab. If the pointer is outside <em class="parameter"><code>confine_to</code></em>, it will
automatically be moved to the closest edge of <em class="parameter"><code>confine_to</code></em> and enter
and leave events will be generated as necessary.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cursor</code></em> :</span></p></td>
<td>the cursor to display while the grab is active. If this is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then
the normal cursors are used for <em class="parameter"><code>window</code></em> and its descendants, and the cursor
for <em class="parameter"><code>window</code></em> is used for all other windows.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
<td>the timestamp of the event which led to this pointer grab. This usually
comes from a <a class="link" href="gdk-Event-Structures.html#GdkEventButton" title="struct GdkEventButton"><span class="type">GdkEventButton</span></a> struct, though <a class="link" href="gdk-Events.html#GDK-CURRENT-TIME:CAPS" title="GDK_CURRENT_TIME"><code class="literal">GDK_CURRENT_TIME</code></a> can be used if
the time isn't known.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a class="link" href="gdk-General.html#GDK-GRAB-SUCCESS:CAPS"><code class="literal">GDK_GRAB_SUCCESS</code></a> if the grab was successful.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GdkGrabStatus"></a><h3>enum GdkGrabStatus</h3>
<pre class="programlisting">typedef enum
{
  GDK_GRAB_SUCCESS         = 0,
  GDK_GRAB_ALREADY_GRABBED = 1,
  GDK_GRAB_INVALID_TIME    = 2,
  GDK_GRAB_NOT_VIEWABLE    = 3,
  GDK_GRAB_FROZEN          = 4
} GdkGrabStatus;
</pre>
<p>
Returned by <a class="link" href="gdk-General.html#gdk-pointer-grab" title="gdk_pointer_grab ()"><code class="function">gdk_pointer_grab()</code></a> and <a class="link" href="gdk-General.html#gdk-keyboard-grab" title="gdk_keyboard_grab ()"><code class="function">gdk_keyboard_grab()</code></a> to indicate
success or the reason for the failure of the grab attempt.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GDK-GRAB-SUCCESS:CAPS"></a><span class="term"><code class="literal">GDK_GRAB_SUCCESS</code></span></p></td>
<td>the resource was successfully grabbed.
</td>
</tr>
<tr>
<td><p><a name="GDK-GRAB-ALREADY-GRABBED:CAPS"></a><span class="term"><code class="literal">GDK_GRAB_ALREADY_GRABBED</code></span></p></td>
<td>the resource is actively grabbed by another client.
</td>
</tr>
<tr>
<td><p><a name="GDK-GRAB-INVALID-TIME:CAPS"></a><span class="term"><code class="literal">GDK_GRAB_INVALID_TIME</code></span></p></td>
<td>the resource was grabbed more recently than the 
  specified time.
</td>
</tr>
<tr>
<td><p><a name="GDK-GRAB-NOT-VIEWABLE:CAPS"></a><span class="term"><code class="literal">GDK_GRAB_NOT_VIEWABLE</code></span></p></td>
<td>the grab window or the <em class="parameter"><code>confine_to</code></em> window are not
  viewable.
</td>
</tr>
<tr>
<td><p><a name="GDK-GRAB-FROZEN:CAPS"></a><span class="term"><code class="literal">GDK_GRAB_FROZEN</code></span></p></td>
<td>the resource is frozen by an active grab of another client.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pointer-ungrab"></a><h3>gdk_pointer_ungrab ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_pointer_ungrab                  (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);</pre>
<p>
Ungrabs the pointer on the default display, if it is grabbed by this 
application.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
<td>a timestamp from a <a class="link" href="gdk-Event-Structures.html#GdkEvent" title="union GdkEvent"><span class="type">GdkEvent</span></a>, or <a class="link" href="gdk-Events.html#GDK-CURRENT-TIME:CAPS" title="GDK_CURRENT_TIME"><code class="literal">GDK_CURRENT_TIME</code></a> if no
timestamp is available.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-pointer-is-grabbed"></a><h3>gdk_pointer_is_grabbed ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gdk_pointer_is_grabbed              (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Returns <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the pointer on the default display is currently 
grabbed by this application.
</p>
<p>
Note that this does not take the inmplicit pointer grab on button
presses into account.
</p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the pointer is currently grabbed by this application.*</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-set-double-click-time"></a><h3>gdk_set_double_click_time ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_set_double_click_time           (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> msec</code></em>);</pre>
<p>
Set the double click time for the default display. See
<a class="link" href="GdkDisplay.html#gdk-display-set-double-click-time" title="gdk_display_set_double_click_time ()"><code class="function">gdk_display_set_double_click_time()</code></a>. 
See also <a class="link" href="GdkDisplay.html#gdk-display-set-double-click-distance" title="gdk_display_set_double_click_distance ()"><code class="function">gdk_display_set_double_click_distance()</code></a>.
Applications should <span class="emphasis"><em>not</em></span> set this, it is a 
global user-configured setting.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>msec</code></em> :</span></p></td>
<td>double click time in milliseconds (thousandths of a second)</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keyboard-grab"></a><h3>gdk_keyboard_grab ()</h3>
<pre class="programlisting"><a class="link" href="gdk-General.html#GdkGrabStatus" title="enum GdkGrabStatus"><span class="returnvalue">GdkGrabStatus</span></a>       gdk_keyboard_grab                   (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> owner_events</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);</pre>
<p>
Grabs the keyboard so that all events are passed to this
application until the keyboard is ungrabbed with <a class="link" href="gdk-General.html#gdk-keyboard-ungrab" title="gdk_keyboard_ungrab ()"><code class="function">gdk_keyboard_ungrab()</code></a>.
This overrides any previous keyboard grab by this client.
</p>
<p>
If you set up anything at the time you take the grab that needs to be cleaned
up when the grab ends, you should handle the <a class="link" href="gdk-Event-Structures.html#GdkEventGrabBroken" title="struct GdkEventGrabBroken"><span class="type">GdkEventGrabBroken</span></a> events that
are emitted when the grab ends unvoluntarily.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>window</code></em> :</span></p></td>
<td>the <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> which will own the grab (the grab window).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>owner_events</code></em> :</span></p></td>
<td>if <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> then all keyboard events are reported with respect to
<em class="parameter"><code>window</code></em>. If <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then keyboard events for this application are reported as
normal, but keyboard events outside this application are reported with respect
to <em class="parameter"><code>window</code></em>. Both key press and key release events are always reported,
independant of the event mask set by the application.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
<td>a timestamp from a <a class="link" href="gdk-Event-Structures.html#GdkEvent" title="union GdkEvent"><span class="type">GdkEvent</span></a>, or <a class="link" href="gdk-Events.html#GDK-CURRENT-TIME:CAPS" title="GDK_CURRENT_TIME"><code class="literal">GDK_CURRENT_TIME</code></a> if no timestamp is
available.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a class="link" href="gdk-General.html#GDK-GRAB-SUCCESS:CAPS"><code class="literal">GDK_GRAB_SUCCESS</code></a> if the grab was successful.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-keyboard-ungrab"></a><h3>gdk_keyboard_ungrab ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_keyboard_ungrab                 (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> time_</code></em>);</pre>
<p>
Ungrabs the keyboard on the default display, if it is grabbed by this 
application.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>time_</code></em> :</span></p></td>
<td>a timestamp from a <a class="link" href="gdk-Event-Structures.html#GdkEvent" title="union GdkEvent"><span class="type">GdkEvent</span></a>, or <a class="link" href="gdk-Events.html#GDK-CURRENT-TIME:CAPS" title="GDK_CURRENT_TIME"><code class="literal">GDK_CURRENT_TIME</code></a> if no
timestamp is available.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-beep"></a><h3>gdk_beep ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_beep                            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Emits a short beep on the default display.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-get-use-xshm"></a><h3>gdk_get_use_xshm ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gdk_get_use_xshm                    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_get_use_xshm</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Returns <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if GDK will attempt to use the MIT-SHM shared memory extension.
</p>
<p>
The shared memory extension is used for <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>, and consequently for
<a class="link" href="gdk-GdkRGB.html" title="GdkRGB">GdkRGB</a>.
It enables much faster drawing by communicating with the X server through
SYSV shared memory calls. However, it can only be used if the X client and
server are on the same machine and the server supports it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if use of the MIT shared memory extension will be attempted.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-set-use-xshm"></a><h3>gdk_set_use_xshm ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_set_use_xshm                    (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> use_xshm</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_set_use_xshm</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Sets whether the use of the MIT shared memory extension should be attempted.
This function is mainly for internal use. It is only safe for an application
to set this to <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, since if it is set to <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> and the server does not
support the extension it may cause warning messages to be output.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>use_xshm</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if use of the MIT shared memory extension should be attempted.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-error-trap-push"></a><h3>gdk_error_trap_push ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_error_trap_push                 (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
This function allows X errors to be trapped instead of the normal behavior
of exiting the application. It should only be used if it is not possible to
avoid the X error in any other way.
</p>
<div class="example">
<a name="id2865635"></a><p class="title"><b>Example 1. Trapping an X error</b></p>
<div class="example-contents"><pre class="programlisting">
  gdk_error_trap_push ();
  /* ... Call the X function which may cause an error here ... */
  /* Flush the X queue to catch errors now. */
  gdk_flush ();
  if (gdk_error_trap_pop ())
    {
      /* ... Handle the error here ... */
    }
</pre></div>
</div>
<br class="example-break">
</div>
<hr>
<div class="refsect2">
<a name="gdk-error-trap-pop"></a><h3>gdk_error_trap_pop ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gdk_error_trap_pop                  (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Removes the X error trap installed with <a class="link" href="gdk-General.html#gdk-error-trap-push" title="gdk_error_trap_push ()"><code class="function">gdk_error_trap_push()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the X error code, or 0 if no error occurred.</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GDK-WINDOWING-X11:CAPS"></a><h3>GDK_WINDOWING_X11</h3>
<pre class="programlisting">#define GDK_WINDOWING_X11
</pre>
<p>
This macro is defined if GDK is configured to use the X backend.
</p>
</div>
<hr>
<div class="refsect2">
<a name="GDK-WINDOWING-WIN32:CAPS"></a><h3>GDK_WINDOWING_WIN32</h3>
<pre class="programlisting">#define GDK_WINDOWING_WIN32
</pre>
<p>
This macro is defined if GDK is configured to use the Win32 backend.
</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.17</div>
</body>
</html>